
<div class="layui-form">


<!--    --><?//if($detail['status']=="已收款"){ ?>
    <a href="../receipt/detail-add.php?nav-itemed=receipt&nid=<? echo $detail['nid']?>" class="layui-btn layui-btn-primary layui-btn-small" target="_blank">生成收据</a>
<!--    --><?//;}
//    else
//    {
//        echo "用户未付款，暂不能开票。<br/>";
//    }
//    ?>





<? $receipt_list= select_lines_all_items($table_Prefix."receipt","receiptdate desc","masterid='".$detail['nid']."'","") ;?>









    <table class="layui-table">
        <colgroup>
            <col width="60">
            <col width="120">
            <col >
            <col >
            <col >
            <col >
            <col >
            <col >
            <col width="150">

            <col>
        </colgroup>
        <thead>
        <tr>
            <th>序号</th>
            <th>对象</th>
            <th>类型</th>
            <th>金额</th>
            <th>日期</th>
            <th>备注</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>


        <?php
        for ($i = 0; $i < count($receipt_list); $i++) {
            ?>
            <tr>
                <td><?echo $i+1 ?></td>
                <td><?echo $receipt_list[$i]['name']?></td>
                <td><?echo $receipt_list[$i]['type']?></td>
                <td><?echo $receipt_list[$i]['cost']?></td>
                <td><?echo substr($receipt_list[$i]['receiptdate'],0,10)?></td>
                <td><?echo $receipt_list[$i]['remark']?></td>
                <td>


                    <?
                    if($receipt_list[$i]['status']!="已失效")
                    {?>
                        <a href="../receipt/detail-edit.php?nid=<? echo $receipt_list[$i]['nid']?>&nav-itemed=receipt" class="layui-btn layui-btn-primary layui-btn-small" >
                            <i class="layui-icon">&#xe642;</i>修改
                        </a>
                        <?;}?>



                    <?
                    if(($_SESSION['mid']=="admin")||($_SESSION['mid']=="finance"))
                    {?>
                        <a href="javascript:void(0)" onclick="popupBoxrec(<?php echo $receipt_list[$i]['nid'] ?>)" class="delete layui-btn layui-btn-primary layui-btn-small" >删除
                            <i class="layui-icon">&#xe640;</i> </a>
                        <?;}?>


                        <a href="<?echo $domain?>/controlbase/receipt/receipt.php?nid=<? echo $receipt_list[$i]['nid']?>&nav-itemed=receipt&type=<?echo $receipt_list[$i]['type']?>"
                           class="layui-btn layui-btn-primary layui-btn-small">
                            打印收据
                        </a>

                </td>
            </tr>
            <?php

        }
        ?>


        </tbody>
    </table>






<?if(0){?>



    <table class="layui-table">
  <colgroup>

	<col >
	<col >
	<col >
	<col >
	<col >


  </colgroup>
  <thead>
    <tr>

      <th>学费收据</th>
      <th>文明驾驶车费</th>
      <th>转学收据</th>
      <th>科目一补考费</th>
      <th>科目二补考费</th>
      <th>科目三补考费</th>
    </tr>
  </thead>
  <tbody>





<!--//查看这条信息有无修改申请，有的话就变色，提示修改中-->
        <? $applymodify=select_one_line_all_items($table_Prefix."member","sid='".$detail['nid']."' and applystatus='申请修改'") ;?>


      <tr <?if($applymodify['nid']){echo "style='color:red'";$status="审核中";}else{$status="正常";}?>>

	  <td><?if($detail['receipt']=="已生成"){echo "已生成";}else{echo "<span style='color:red'>未生成<span></span>";} ?></td>
          <? $count_healthform=count_by_item($table_Prefix."healthform","masterid='".$detail['nid']."'");?>
          <td><?if($detail['wenmingjiashi']){echo "已生成";}else{echo "<span style='color:red'>未生成<span></span>";} ?></td>

          <td><?if($detail['zhuanxue']){echo "已生成";}else{echo "<span style='color:red'>未生成<span></span>";} ?></td>

          <td><?if($detail['kemuyibukao']){echo "已生成";}else{echo "<span style='color:red'>未生成<span></span>";} ?></td>

          <td><?if($detail['kemuerbukao']){echo "已生成";}else{echo "<span style='color:red'>未生成<span></span>";} ?></td>


          <td><?if($detail['kemusanbukao']){echo "已生成";}else{echo "<span style='color:red'>未生成<span></span>";} ?></td>


    </tr>



<tr >




    <td>
        <?if(($detail['status']=="已收款")&&($detail['receipt']=="未生成")){ ?>
            <a href="../receipt/detail-add.php?nav-itemed=receipt&nid=<? echo $detail['nid']?>&type=xuefei" class="layui-btn layui-btn-primary layui-btn-small" target="_blank">生成收据</a>
        <?}?>
        <?if($detail['receipt']=="已生成"){ ?>
            <a href="../receipt/receipt.php?nav-itemed=receipt&nid=<? echo $detail['nid']?>&type=xuefei" class="layui-btn layui-btn-primary layui-btn-small" target="_blank">打印收据</a>
        <?}?>
    </td>

    <td>
        <?if(($detail['status']=="已收款")&&(!$detail['wenmingjiashichewei'])){ ?>
            <a href="../receipt/detail-add.php?nav-itemed=receipt&nid=<? echo $detail['nid']?>&type=wenmingjiashichefei" class="layui-btn layui-btn-primary layui-btn-small" target="_blank">生成收据</a>
        <?}?>
        <?if($detail['wenmingjiashichewei']){ ?>
            <a href="../receipt/receipt.php?nav-itemed=receipt&nid=<? echo $detail['nid']?>&type=wenmingjiashichefei" class="layui-btn layui-btn-primary layui-btn-small" target="_blank">打印收据</a>
        <?}?>
    </td>



    <td>
        <?if(($detail['status']=="已收款")&&(!$detail['zhuanxue'])){ ?>
            <a href="../receipt/detail-add.php?nav-itemed=receipt&nid=<? echo $detail['nid']?>&type=zhuanxue" class="layui-btn layui-btn-primary layui-btn-small" target="_blank">生成收据</a>
        <?}?>
        <?if($detail['zhuanxue']){ ?>
            <a href="../receipt/receipt.php?nav-itemed=receipt&nid=<? echo $detail['nid']?>&type=zhuanxue" class="layui-btn layui-btn-primary layui-btn-small" target="_blank">打印收据</a>
        <?}?>
    </td>




    <td>
        <?if(($detail['status']=="已收款")&&(!$detail['kemuyibukao'])){ ?>
            <a href="../receipt/detail-add.php?nav-itemed=receipt&nid=<? echo $detail['nid']?>&type=kemuyibukao" class="layui-btn layui-btn-primary layui-btn-small" target="_blank">生成收据</a>
        <?}?>
        <?if($detail['kemuyibukao']){ ?>
            <a href="../receipt/receipt.php?nav-itemed=receipt&nid=<? echo $detail['nid']?>&type=kemuyibukao" class="layui-btn layui-btn-primary layui-btn-small" target="_blank">打印收据</a>
        <?}?>
    </td>



    <td>
        <?if(($detail['status']=="已收款")&&(!$detail['kemuerbukao'])){ ?>
            <a href="../receipt/detail-add.php?nav-itemed=receipt&nid=<? echo $detail['nid']?>&type=kemuerbukao" class="layui-btn layui-btn-primary layui-btn-small" target="_blank">生成收据</a>
        <?}?>
        <?if($detail['kemuerbukao']){ ?>
            <a href="../receipt/receipt.php?nav-itemed=receipt&nid=<? echo $detail['nid']?>&type=kemuerbukao" class="layui-btn layui-btn-primary layui-btn-small" target="_blank">打印收据</a>
        <?}?>
    </td>


    <td>
        <?if(($detail['status']=="已收款")&&(!$detail['kemusanbukao'])){ ?>
            <a href="../receipt/detail-add.php?nav-itemed=receipt&nid=<? echo $detail['nid']?>&type=kemusanbukao" class="layui-btn layui-btn-primary layui-btn-small" target="_blank">生成收据</a>
        <?}?>
        <?if($detail['kemusanbukao']){ ?>
            <a href="../receipt/receipt.php?nav-itemed=receipt&nid=<? echo $detail['nid']?>&type=kemusanbukao" class="layui-btn layui-btn-primary layui-btn-small" target="_blank">打印收据</a>
        <?}?>
    </td>



</tr>



  </tbody>

</table>

 </div>

<?}?>

<?php

if (count($receipt_list) == 0) {
    echo "数据添加中";
}

?>



<script>
    function popupBoxrec(nid){
        document.getElementById('delete-box').style.display='block';
        document.getElementById("sure_btn").innerHTML = "<a href='../receipt/detail-delete.php?nid="+nid+"'>确认</a>";

    };
    function closePopup(){
        document.getElementById('delete-box').style.display='none';
    }
</script>
